#ifndef _SYS_STATE_FUNC_H_
#define _SYS_STATE_FUNC_H_

typedef struct _cpuOccupy
{
		char name[20];
		unsigned int user;
		unsigned int nice;
		unsigned int system;
		unsigned int idle;
		unsigned int ioWait;
		unsigned int irq;
		unsigned int softIrq;
}CpuOccupy;

typedef struct _memoryOccupy
{
		char totalName[20];
		unsigned long long total;
		char totalUnit[5];
		char freeName[20];
		unsigned long long free;
		char freeUnit[5];
}MemoryOccupy;

typedef enum _spaceType
{
		_totalSpaceKB = 0,
		_totalSpaceB,
		_freeSpaceKB,
		_freeSpaceB,
		_useSpaceKB,
		_useSpaceB,
		
		_maxSpaceType,
}SpaceType;

int getCpuUsagePercent(unsigned char &cpuUsagePercent);
static int getCpuOccupyInfo(CpuOccupy *cpuStatus);
static int calcCpuOccupyPercent(CpuOccupy *c1, CpuOccupy *c2, unsigned char &cpuUsagePercent);

int getMemoryOccupy(unsigned long long &total, unsigned long long &use);

int getInternalSdInfo(unsigned long long &totalBytes, unsigned long long &useBytes);
int getExternalSdInfo(unsigned long long &totalBytes, unsigned long long &useBytes);
static int getStorageInfo(const char *mountPoint, unsigned long long &totalBytes, unsigned long long &useBytes);
static int getStorageInfo(const char *mountPoint, unsigned long long &capacity, SpaceType spaceType);

int checkUsbStorage(unsigned char &has);


#endif